﻿using System;
using System.Collections.Generic;
using System.Text;
using T.FAS.Runtime.Action.Entity;
using T.FAS.Runtime.Action.SPI;
using T.FAS.Runtime.Base.Entity;

namespace T.FAS.Runtime.Action.SGSPI
{
    public interface IActionSGService
    {
        /// <summary>
        /// Action执行
        /// </summary>
        /// <param name="actionId"></param>
        /// <param name="parameters"></param>
        /// <returns>ViewModelResult</returns>
        TResult Execute(string actionId, List<ActionParameter> parameters);

        /// <summary>
        /// DataQuery执行
        /// </summary>
        /// <param name="dqId"></param>
        /// <param name="parameters"></param>
        /// <returns>ViewModelResult</returns>
        TResult DQExecute(string dqId, List<ActionParameter> parameters);
        /// <summary>
        /// CDO执行
        /// </summary>
        /// <param name="cdoId">CDO的ID或者Code</param>
        /// <param name="actionType">动作类型</param>
        /// <param name="parameters">参数列表</param>
        /// <returns></returns>
        TResult CDOExecute(string cdoId, SPI.ActionType actionType, List<ActionParameter> parameters);

        /// <summary>
        /// 根据ActionID列表获取Action元数据及返回值TSchema信息
        /// </summary>
        /// <param name="actionIds"></param>
        /// <returns></returns>
        List<ActionInfoWithSchema> GetActionInfoWithSchema(List<string> actionIds);
        /// <summary>
        /// 根据ActionID和DQ列表获取所有Action元数据及返回值TSchema信息
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        List<ActionInfoWithSchema> GetAllInfoWithSchema(string filter);
        /// <summary>
        /// 获取给定的DataBase的Schema信息
        /// </summary>
        /// <param name="filter"></param>
        /// <returns></returns>
        List<DataBaseInfoView> GetDBInfoViews(List<string> dbCodes);
    }
}
